﻿using Prism.Commands;
using Prism.Regions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace Zhy.PrismRegion.Navigat.ViewModels.Pages
{
    /// <summary>
    /// 导航接口：INavigationAware
    /// </summary>
    public class ViewBViewModel : INavigationAware
    {
        public string Title { get; set; } = "View B";

        /// <summary>
        /// 是否允许重复导航进来
        /// </summary>
        /// <param name="navigationContext"></param>
        /// <returns></returns>
        public bool IsNavigationTarget(NavigationContext navigationContext)
        {
            return true;
        }

        /// <summary>
        /// 从当前View导航出去的时候触发
        /// </summary>
        /// <param name="navigationContext"></param>
        public void OnNavigatedFrom(NavigationContext navigationContext)
        {

        }

        /// <summary>
        /// 打开当前View的时候触发
        /// </summary>
        /// <param name="navigationContext"></param>
        public void OnNavigatedTo(NavigationContext navigationContext)
        {
            string arg = navigationContext.Parameters.GetValue<string>("abcd");
        }
    }
}
